package com.cqrt.controller;

import com.cqrt.service.HistoryDataImportService;
import com.ty.basic.response.ResponseResult;
import com.ty.ppm.model.constant.ApiPathConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;


@RestController
@RequestMapping(ApiPathConstant.PARENT_VERSION_ONE_PATH+ "history")
@Api(tags = "历史数据导入")
public class HistoryDataImportController {

    @Resource
    private HistoryDataImportService historyDataImportService;

    @PostMapping("/import")
    @ApiOperation(value = "导入历史年度项目", produces = "application/json; charset=utf-8")
    public ResponseResult<T> importExcel(@RequestParam("file") MultipartFile file) {
        historyDataImportService.importAnnualProject(file);
        return ResponseResult.success();
    }




}
